﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ST.Common
{
    public class BasePage:System.Web.UI.Page
    {
        private string _primarykey = string.Empty;
        public string PrimaryKey { 
            get 
            {
            if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "")
                _primarykey = Request.QueryString["id"].ToString();
            return _primarykey;
            } 
        }
        public bool IsEdit {
            get {
                if (string.IsNullOrEmpty(PrimaryKey))
                    return false;
                else
                    return true;
            }
        }
        /// <summary>
        /// 页面的js弹出框
        /// </summary>
        /// <param name="message"></param>
        public void MessageBox(string message)
        {
            if(!Page.ClientScript.IsClientScriptBlockRegistered("alert"))
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", string.Format("alert('{0}')",message), true);
        }
    }
}
